package com.yfp.client.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfp.client.domain.SysOperationLog;
import com.yfp.client.mapper.SysOperationLogMapper;
import com.yfp.client.service.SysOperationLogService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 *
 * @description 针对表【sys_operation_log】的数据库操作Service实现
 * @createDate 2025-01-04 16:24:31
 */
@Service
public class SysOperationLogServiceImpl extends ServiceImpl<SysOperationLogMapper, SysOperationLog> implements SysOperationLogService {

    @Resource
    private SysOperationLogMapper sysOperationLogMapper;

    @Override
    public Boolean existBreakage(String machineId) {
        SysOperationLog sysOperationLog = sysOperationLogMapper.existBreakage(machineId);
        if (Objects.isNull(sysOperationLog)){
            return false;
        }

        return sysOperationLog.getType().equals(2);
    }

    @Override
    public SysOperationLog lastSyncPlan(String machineId) {
        return sysOperationLogMapper.lastSyncPlan(machineId);
    }
}




